const express = require('express');
const querystring = require('querystring')
const app = express();
app.listen(3000)
app.get('/reg', (req, res) => {
	res.sendFile(__dirname + '/homework.html')
})
app.post('/myreg', (req, res) => {
	req.on('data', (chunk) => {

		var str = chunk.toString()
         //借助字符串模块解析对象
		var obj = querystring.parse(str);
		
		res.send('注册成功 当前用户名:' + obj.user)
	})
})
